<?php

class FrontOffice extends Controller {

	private $_newsmanager;
	private $_productsmanager;
	private $_tnews;
	private $_tproducts;
	private $_tabilities;

    public function __construct() {
		
        $this->setTplFile(PATH_TPL . 'Index.tpl.php');
		$this->_newsmanager = new NewsModel();
		$this->_tnews = $this->_newsmanager->getList('display');
		$this->_productsmanager = new ProductsModel();
		$this->_tproducts = $this->_productsmanager->getList('display');
		$this->_abilitiesmanager = new AbilitiesModel();
		$this->_tabilities = $this->_abilitiesmanager->getList('display');
		
    }
	
	public function tnews() {
		return $this->_tnews;
	}
	
	public function tabilities() {
		return $this->_tabilities;
	}
	
	public function tproducts() {
		return $this->_tproducts;
	}
	
	public function clearMethod() {
		$this->setIsAjax(false);
	}

    public function ajaxMethod() {
	
		$this->setIsAjax(true);
		
		if (isset($_POST['getuser']) && $_POST['getuser'] == true) {
			$user = new User();
			$check = $user->checkUser();
			$this->addAjaxDatas('returnDatas', $check);
		}
		
    }

}

?>